package ycl.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import ycl.common.base.entity.BaseEntity;
import ycl.common.constants.BaseConstant;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 管理员表
 * </p>
 *
 * @author ycl
 * @since 2022-03-03 11:43:57
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("sys_admin")
@ApiModel(value = "SysAdmin对象", description = "管理员表")
public class SysAdmin extends BaseEntity {

	
	private static final long serialVersionUID = 1L;

	@Schema(description = "用户名")
	@TableField("username")
	private String username;

	@Schema(description = "密码")
	@TableField("password")
	private String password;

	@Schema(description = "加密盐")
	@TableField("salt")
	private String salt;

	@Schema(description = "头像")
	@TableField("avatar")
	private String avatar;

	@Schema(description = "真实名")
	@TableField("real_name")
	private String realName;

	@Schema(description = "身份证")
	@TableField("id_card")
	private String idCard;

	@Schema(description = "性别，1男，0女")
	@TableField("sex")
	private Boolean sex;

	@Schema(description = "注册时间")
	@JsonFormat(pattern = BaseConstant.DATE_PATTERN, timezone = BaseConstant.DATE_TIME_GMT8)
	private LocalDate birthday;

	@Schema(description = "登录信息")
	@TableField("token")
	private String token;

	@Schema(description = "用户类型，0超管，1普通管理员")
	@TableField("type")
	private Integer type;

	@Schema(description = "手机号")
	@TableField("mobile")
	private String mobile;

	@Schema(description = "状态，0正常，1禁用")
	@TableField("status")
	private Integer status;

	@Schema(description = "注册时间")
	@TableField("register_time")
	@JsonFormat(pattern = BaseConstant.DATE_TIME_PATTERN, timezone = BaseConstant.DATE_TIME_GMT8)
	private LocalDateTime registerTime;

	@Schema(description = "是否锁住，锁住不可登录，0否，1是")
	@TableField("locked")
	private Boolean locked;

	@Schema(description = "登录地址")
	@TableField("login_ip")
	private String loginIp;

	@Schema(description = "登录时间")
	@TableField("login_time")
	@JsonFormat(pattern = BaseConstant.DATE_TIME_PATTERN, timezone = BaseConstant.DATE_TIME_GMT8)
	private LocalDateTime loginTime;

	@Schema(description = "上次登录时间")
	@TableField("last_login_time")
	@JsonFormat(pattern = BaseConstant.DATE_TIME_PATTERN, timezone = BaseConstant.DATE_TIME_GMT8)
	private LocalDateTime lastLoginTime;

	@Schema(description = "上次登录地址")
	@TableField("last_login_ip")
	private String lastLoginIp;

	@Schema(description = "退出时间")
	@TableField("logout_time")
	@JsonFormat(pattern = BaseConstant.DATE_TIME_PATTERN, timezone = BaseConstant.DATE_TIME_GMT8)
	private LocalDateTime logoutTime;


}
